/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gmovil_jpa.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author castlerock
 */
@Entity
@Table(name = "tipo_comision")
@NamedQueries({
    @NamedQuery(name = "TipoComision.findAll", query = "SELECT t FROM TipoComision t"),
    @NamedQuery(name = "TipoComision.findByIdTipoComision", query = "SELECT t FROM TipoComision t WHERE t.idTipoComision = :idTipoComision"),
    @NamedQuery(name = "TipoComision.findByTipoComision", query = "SELECT t FROM TipoComision t WHERE t.tipoComision = :tipoComision"),
    @NamedQuery(name = "TipoComision.findByObservacion", query = "SELECT t FROM TipoComision t WHERE t.observacion = :observacion")})
public class TipoComision implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tipo_comision")
    private Integer idTipoComision;
    @Basic(optional = false)
    @Column(name = "tipo_comision")
    private String tipoComision;
    @Column(name = "observacion")
    private String observacion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoComision")
    private List<Comision> comisionList;

    public TipoComision() {
    }

    public TipoComision(Integer idTipoComision) {
        this.idTipoComision = idTipoComision;
    }

    public TipoComision(Integer idTipoComision, String tipoComision) {
        this.idTipoComision = idTipoComision;
        this.tipoComision = tipoComision;
    }

    public Integer getIdTipoComision() {
        return idTipoComision;
    }

    public void setIdTipoComision(Integer idTipoComision) {
        this.idTipoComision = idTipoComision;
    }

    public String getTipoComision() {
        return tipoComision;
    }

    public void setTipoComision(String tipoComision) {
        this.tipoComision = tipoComision;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public List<Comision> getComisionList() {
        return comisionList;
    }

    public void setComisionList(List<Comision> comisionList) {
        this.comisionList = comisionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoComision != null ? idTipoComision.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoComision)) {
            return false;
        }
        TipoComision other = (TipoComision) object;
        if ((this.idTipoComision == null && other.idTipoComision != null) || (this.idTipoComision != null && !this.idTipoComision.equals(other.idTipoComision))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gmovil_jpa.entidades.TipoComision[idTipoComision=" + idTipoComision + "]";
    }

}
